Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Levels Colorization
This pull request adds colorization support for log levels in the logging package. Each log level is assigned a specific color based on its string representation, providing improved visual distinction for log entries.
Changes Made
ColorizeLevel
function.DefaultColor
,DebugColor
,InfoColor
, etc.).Color
interface and added corresponding methods to retrieve the ANSI escape codes for each color.PrintColor
function to set the appropriate color for the log level and print it.Usage
To use the colorized log levels, simply call the
ColorizeLevel
function and pass the log level as an argument. For example:Example of output: